package controllers

import (
	"github.com/astaxie/beego"
)

type MainController struct {
	beego.Controller
}

func (c *MainController) Get() {
	c.Data["Website"] = "https://gitee.com/www-ly-cn"
	c.Data["Email"] = "liu67839@gmail.com"
	c.Data["Path"] = "/index"
	c.Data["Method"] = "post"
	c.TplName = "index.html"
}

type IndexController struct {
	beego.Controller
}

func (c *IndexController) Post() {
	c.Data["Website"] = "https://gitee.com/www-ly-cn"
	c.Data["Email"] = "194962218@qq.com"
	c.Data["Path"] = "/"
	c.Data["Method"] = "get"
	c.TplName = "index.html"
}
func (c *IndexController) ShowGet() {
	c.Data["Website"] = "https://gitee.com/www-ly-cn"
	c.Data["Email"] = "194962218@qq.com"
	c.Data["Path"] = "/home"
	c.Data["Method"] = "post"
	id := c.GetString(":id")
	beego.Info(id)

	// *.*
	p := c.GetString(":path")
	ext := c.GetString(":ext")
	beego.Info(p + "." + ext)

	// *
	a := c.GetString(":splat")
	beego.Info(a)

	c.TplName = "index.html"
}

func (c *IndexController) ShowPost() {
	c.Data["Website"] = "https://gitee.com/www-ly-cn"
	c.Data["Email"] = "194962218@qq.com"
	c.Data["Path"] = "/"
	c.Data["Method"] = "get"
	c.TplName = "index.html"
}